Skip to content

Conversation

@daniel-lxs
Copy link
Member

@daniel-lxs daniel-lxs commented Jun 24, 2025

Closes: #4410

This PR fixes disappearing task names in task history and internationalizes the fallback task names for better user experience across all supported languages.

Changes Made:

Bug Fixes

  • Fixed disappearing task names in history: Added robust fallback logic to ensure tasks always have meaningful names
  • Enhanced error handling: Added comprehensive handling for edge cases where message arrays are empty or malformed
  • Fixed TypeScript issues: Added missing contextTokens field to ensure type consistency with TokenUsage interface

Code Refactoring

  • Eliminated code duplication: Restructured taskMetadata() to use single historyItem creation instead of duplicating object creation
  • Improved maintainability: Used hasMessages flag and pre-calculated values for better code organization
  • Enhanced readability: Simplified task name assignment logic and lastRelevantMessage fallback

Internationalization

  • Added translation support: Implemented t() function from i18n module in taskMetadata.ts
  • Created new translation keys: Added tasks.incomplete and tasks.no_messages to common.json
  • Complete language coverage: Added translations for all 16 supported languages:
    • English, German, Spanish, French, Italian, Japanese, Korean
    • Chinese (Simplified & Traditional), Dutch, Polish, Portuguese (Brazil)
    • Russian, Turkish, Vietnamese, Hindi, Catalan

Impact:

  • Task history entries now consistently show meaningful names in the user's preferred language
  • No more blank entries in the task list
  • Improved code quality following DRY principles
  • Better error resilience for edge cases

Original by @kiwina

@daniel-lxs daniel-lxs requested review from cte, jr and mrubens as code owners June 24, 2025 13:03
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Jun 24, 2025
@delve-auditor
Copy link

delve-auditor bot commented Jun 24, 2025

No security or compliance issues detected. Reviewed everything up to 670085a.

Security Overview
  • 🔎 Scanned files: 19 changed file(s)
Detected Code Changes
Change Type Relevant files
Enhancement ► taskMetadata.ts
    Add task status handling for incomplete/no message cases
► locales/*.json
    Add Indonesian and other language translations for task metadata

Reply to this PR with @delve-auditor followed by a description of what change you want and we'll auto-submit a change to this PR to implement it.

kiwina and others added 4 commits June 24, 2025 08:06
- Handle edge case where tasks have no messages at all
- Provide fallback names for tasks with empty/blank names
- Ensure taskHistory entries are never blank, even after crashes
- Add proper error handling for incomplete tasks

Fixes cases where task history would show blank entries when:
- Task crashes before first message is added
- First message is malformed or empty
- Task creation fails completely
- Add translation support to taskMetadata.ts using t() function
- Add 'incomplete' and 'no_messages' keys to all supported locales
- Replace hardcoded English strings with i18n keys:
  - 'Task #{{taskNumber}} (Incomplete)' → 'common:tasks.incomplete'
  - 'Task #{{taskNumber}} (No messages)' → 'common:tasks.no_messages'
- Translations added for all 16 supported languages:
  ca, de, en, es, fr, hi, it, ja, ko, nl, pl, pt-BR, ru, tr, vi, zh-CN, zh-TW
- Verified complete translation coverage with missing translations script

Addresses internationalization of task history display names
- Add 'incomplete' and 'no_messages' keys to id/common.json
- Complete translation coverage for all 17 supported languages
- Verified with missing translations script
@daniel-lxs daniel-lxs force-pushed the fix/disappearing-task-i18n branch from cb08796 to 670085a Compare June 24, 2025 13:12
@daniel-lxs daniel-lxs moved this from Triage to PR [Needs Review] in Roo Code Roadmap Jun 24, 2025
@daniel-lxs daniel-lxs changed the title feat(i18n): Refactor and internationalize task metadata Add default task names for empty tasks Jun 24, 2025
@mrubens mrubens merged commit 03052f8 into main Jun 24, 2025
16 checks passed
@mrubens mrubens deleted the fix/disappearing-task-i18n branch June 24, 2025 15:35
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jun 24, 2025
@github-project-automation github-project-automation bot moved this from PR [Needs Review] to Done in Roo Code Roadmap Jun 24, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jun 24, 2025
cte pushed a commit that referenced this pull request Jun 24, 2025
Alorse pushed a commit to Alorse/Roo-Code that referenced this pull request Jun 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request lgtm This PR has been approved by a maintainer PR - Needs Review size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Task History Shows Blank/Empty Task Names

5 participants